//
// CTextContextUser.java
// Copyright (C) 2010  "Naush" <naush _ hotmail _ fr>
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero General Public License as
// published by the Free Software Foundation, either version 3 of the
// License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
// GNU Affero General Public License for more details.
//
// You should have received a copy of the GNU Affero General Public License
// along with this program.  If not, see <http://www.gnu.org/licenses/>./* ----------------------------------------------------------------------------







package org.ryzom.nel.threed;

import org.ryzom.nel.misc.CRGBA;

public class CTextContextUser {
  private long swigCPtr;
  protected boolean swigCMemOwn;

  public CTextContextUser(long cPtr, boolean cMemoryOwn) {
    swigCMemOwn = cMemoryOwn;
    swigCPtr = cPtr;
  }

  public static long getCPtr(CTextContextUser obj) {
    return (obj == null) ? 0 : obj.swigCPtr;
  }

  protected void finalize() {
    delete();
  }

  public synchronized void delete() {
    if (swigCPtr != 0) {
      if (swigCMemOwn) {
        swigCMemOwn = false;
        nel3dJNI.delete_CTextContextUser(swigCPtr);
      }
      swigCPtr = 0;
    }
  }

  public CTextContextUser(String fontFileName, String fontExFileName, CDriverUser drv, CFontManager fmg) {
    this(nel3dJNI.new_CTextContextUser(fontFileName, fontExFileName, CDriverUser.getCPtr(drv), drv, CFontManager.getCPtr(fmg), fmg), true);
  }

  public void setColor(CRGBA color) {
    nel3dJNI.CTextContextUser_setColor(swigCPtr, this, CRGBA.getCPtr(color), color);
  }

  public void setFontSize(long fontSize) {
    nel3dJNI.CTextContextUser_setFontSize(swigCPtr, this, fontSize);
  }

  public long getFontSize() {
    return nel3dJNI.CTextContextUser_getFontSize(swigCPtr, this);
  }

  public void setHotSpot(SWIGTYPE_p_THotSpot hotSpot) {
    nel3dJNI.CTextContextUser_setHotSpot(swigCPtr, this, SWIGTYPE_p_THotSpot.getCPtr(hotSpot));
  }

  public SWIGTYPE_p_THotSpot getHotSpot() {
    return new SWIGTYPE_p_THotSpot(nel3dJNI.CTextContextUser_getHotSpot(swigCPtr, this), true);
  }

  public void setScaleX(float scaleX) {
    nel3dJNI.CTextContextUser_setScaleX(swigCPtr, this, scaleX);
  }

  public void setScaleY(float scaleY) {
    nel3dJNI.CTextContextUser_setScaleY(swigCPtr, this, scaleY);
  }

  public float getScaleX() {
    return nel3dJNI.CTextContextUser_getScaleX(swigCPtr, this);
  }

  public float getScaleY() {
    return nel3dJNI.CTextContextUser_getScaleY(swigCPtr, this);
  }

  public void setShaded(boolean b) {
    nel3dJNI.CTextContextUser_setShaded(swigCPtr, this, b);
  }

  public boolean getShaded() {
    return nel3dJNI.CTextContextUser_getShaded(swigCPtr, this);
  }

  public void setShadeExtent(float shext) {
    nel3dJNI.CTextContextUser_setShadeExtent(swigCPtr, this, shext);
  }

  public void setShadeColor(CRGBA sc) {
    nel3dJNI.CTextContextUser_setShadeColor(swigCPtr, this, CRGBA.getCPtr(sc), sc);
  }

  public CRGBA getShadeColor() {
    return new CRGBA(nel3dJNI.CTextContextUser_getShadeColor(swigCPtr, this), true);
  }

  public void setKeep800x600Ratio(boolean keep) {
    nel3dJNI.CTextContextUser_setKeep800x600Ratio(swigCPtr, this, keep);
  }

  public boolean getKeep800x600Ratio() {
    return nel3dJNI.CTextContextUser_getKeep800x600Ratio(swigCPtr, this);
  }

  public long textPush(String format) {
    return nel3dJNI.CTextContextUser_textPush__SWIG_0(swigCPtr, this, format);
  }

  public long textPush(SWIGTYPE_p_ucstring str) {
    return nel3dJNI.CTextContextUser_textPush__SWIG_1(swigCPtr, this, SWIGTYPE_p_ucstring.getCPtr(str));
  }

  public void setStringColor(long i, CRGBA newCol) {
    nel3dJNI.CTextContextUser_setStringColor(swigCPtr, this, i, CRGBA.getCPtr(newCol), newCol);
  }

  public void setStringSelection(long i, long selectStart, long selectSize) {
    nel3dJNI.CTextContextUser_setStringSelection(swigCPtr, this, i, selectStart, selectSize);
  }

  public void resetStringSelection(long i) {
    nel3dJNI.CTextContextUser_resetStringSelection(swigCPtr, this, i);
  }

  public void erase(long i) {
    nel3dJNI.CTextContextUser_erase(swigCPtr, this, i);
  }

  public SWIGTYPE_p_CStringInfo getStringInfo(long i) {
    return new SWIGTYPE_p_CStringInfo(nel3dJNI.CTextContextUser_getStringInfo__SWIG_0(swigCPtr, this, i), true);
  }

  public SWIGTYPE_p_CStringInfo getStringInfo(SWIGTYPE_p_ucstring ucstr) {
    return new SWIGTYPE_p_CStringInfo(nel3dJNI.CTextContextUser_getStringInfo__SWIG_1(swigCPtr, this, SWIGTYPE_p_ucstring.getCPtr(ucstr)), true);
  }

  public void clear() {
    nel3dJNI.CTextContextUser_clear(swigCPtr, this);
  }

  public void printAt(float x, float y, long i) {
    nel3dJNI.CTextContextUser_printAt__SWIG_0(swigCPtr, this, x, y, i);
  }

  public void printClipAt(URenderStringBuffer renderBuffer, float x, float y, long i, float xmin, float ymin, float xmax, float ymax) {
    nel3dJNI.CTextContextUser_printClipAt(swigCPtr, this, URenderStringBuffer.getCPtr(renderBuffer), renderBuffer, x, y, i, xmin, ymin, xmax, ymax);
  }

  public void printClipAtUnProjected(URenderStringBuffer renderBuffer, CFrustum frustum, SWIGTYPE_p_NLMISC__CMatrix scaleMatrix, float x, float y, float depth, long i, float xmin, float ymin, float xmax, float ymax) {
    nel3dJNI.CTextContextUser_printClipAtUnProjected(swigCPtr, this, URenderStringBuffer.getCPtr(renderBuffer), renderBuffer, CFrustum.getCPtr(frustum), frustum, SWIGTYPE_p_NLMISC__CMatrix.getCPtr(scaleMatrix), x, y, depth, i, xmin, ymin, xmax, ymax);
  }

  public void printClipAtOld(float x, float y, long i, float xmin, float ymin, float xmax, float ymax) {
    nel3dJNI.CTextContextUser_printClipAtOld(swigCPtr, this, x, y, i, xmin, ymin, xmax, ymax);
  }

  public void printAt(float x, float y, SWIGTYPE_p_ucstring ucstr) {
    nel3dJNI.CTextContextUser_printAt__SWIG_1(swigCPtr, this, x, y, SWIGTYPE_p_ucstring.getCPtr(ucstr));
  }

  public void printfAt(float x, float y, String format) {
    nel3dJNI.CTextContextUser_printfAt(swigCPtr, this, x, y, format);
  }

  public void render3D(SWIGTYPE_p_NLMISC__CMatrix mat, SWIGTYPE_p_ucstring ucstr) {
    nel3dJNI.CTextContextUser_render3D__SWIG_0(swigCPtr, this, SWIGTYPE_p_NLMISC__CMatrix.getCPtr(mat), SWIGTYPE_p_ucstring.getCPtr(ucstr));
  }

  public void render3D(SWIGTYPE_p_NLMISC__CMatrix mat, String format) {
    nel3dJNI.CTextContextUser_render3D__SWIG_1(swigCPtr, this, SWIGTYPE_p_NLMISC__CMatrix.getCPtr(mat), format);
  }

  public float getLastXBound() {
    return nel3dJNI.CTextContextUser_getLastXBound(swigCPtr, this);
  }

  public void dumpCacheTexture(String filename) {
    nel3dJNI.CTextContextUser_dumpCacheTexture(swigCPtr, this, filename);
  }

  public URenderStringBuffer createRenderBuffer() {
    long cPtr = nel3dJNI.CTextContextUser_createRenderBuffer(swigCPtr, this);
    return (cPtr == 0) ? null : new URenderStringBuffer(cPtr, false);
  }

  public void deleteRenderBuffer(URenderStringBuffer buffer) {
    nel3dJNI.CTextContextUser_deleteRenderBuffer(swigCPtr, this, URenderStringBuffer.getCPtr(buffer), buffer);
  }

  public void flushRenderBuffer(URenderStringBuffer buffer) {
    nel3dJNI.CTextContextUser_flushRenderBuffer(swigCPtr, this, URenderStringBuffer.getCPtr(buffer), buffer);
  }

  public void flushRenderBufferUnProjected(URenderStringBuffer buffer, boolean zwrite) {
    nel3dJNI.CTextContextUser_flushRenderBufferUnProjected(swigCPtr, this, URenderStringBuffer.getCPtr(buffer), buffer, zwrite);
  }

  public CTextContext getTextContext() {
    return new CTextContext(nel3dJNI.CTextContextUser_getTextContext(swigCPtr, this), false);
  }

  public void setLetterColors(ULetterColors letterColors, long index) {
    nel3dJNI.CTextContextUser_setLetterColors(swigCPtr, this, ULetterColors.getCPtr(letterColors), letterColors, index);
  }

  public boolean isSameLetterColors(ULetterColors letterColors, long index) {
    return nel3dJNI.CTextContextUser_isSameLetterColors(swigCPtr, this, ULetterColors.getCPtr(letterColors), letterColors, index);
  }

  public ULetterColors createLetterColors() {
    long cPtr = nel3dJNI.CTextContextUser_createLetterColors(swigCPtr, this);
    return (cPtr == 0) ? null : new ULetterColors(cPtr, false);
  }

}
